<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <script>
      var time = prompt('请输入时间');
      if (time >= 11) {
        alert('中午好');
      } else if (time >= 14 && time<=16) {
        alert('下午好');
      } else if (time >= 17 && time<=19) {
        alert('伴晚好');
      } else {
        alert('深夜好');
      }

      // alert(time);
    </script>
  </body>
</html>
